home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus Special 16 / AMIGAplus Sonderheft 16 (1998)(ICP)(DE)[!].iso / pd / anwendungen / ispell-3.1.18bin / interfaces / guispell-1.1 / rexx / ced / wordspellcallback.rexx < prev   
OS/2 REXX Batch file  |  1995-09-21  |  1KB  |  48 lines

  1. /*  
  2.  *  WordSpellCallBack.rexx ... needed by WordSpell.ced.
  3.  *  Copyright © 1991, 1992  Loren J. Rittle
  4.  *  Reworked for GUISpell public release: Thu Mar 26 02:12:39 1992 LJR
  5.  *  Use as you will, just document your changes and keep my copyright
  6.  *  notice intact.
  7.  *
  8.  *  Loren J. Rittle
  9.  *  rittle@comm.mot.com
  10.  */
  11. options results
  12.  
  13. address 'rexx_ced'
  14.  
  15. parse arg oldbytepos oldlinepos olditem
  16.  
  17. status 87; bytepos = result; if bytepos ~= oldbytepos then exit;
  18. status 57; linepos = result; if linepos ~= oldlinepos then exit;
  19. status 55; line = result;
  20. parse var line curline '0a'x
  21.  
  22. curpos = 0
  23. do forever
  24.   curpos=pos('09'x, curline, curpos+1)
  25.   if curpos == 0 then break
  26.   curline = overlay(' ', curline, curpos)
  27. end
  28.  
  29. do i = 1 to words(curline)
  30.   if wordindex(curline, i)-1 > bytepos then
  31.     break
  32. end
  33.  
  34. item = compress( word( curline, i-1 ), ' ~`,./<>?;:"[]{}!@#$%^&*()+|=\' )
  35.  
  36. if item ~= olditem then exit;
  37.  
  38. address 'GUISpell' currenttext
  39. replacementword = result
  40. right
  41. search for... item 0 0 0 1
  42. if rc ~= 0 then exit;
  43. status 57; linepos = result; if linepos ~= oldlinepos then exit;
  44. left
  45. replace item replacementword 0 0 1 1
  46.  
  47. exit
  48.